package dominia.mtg;



public abstract class MTGCard {

	/**
	 * The available card types.  These are used as a bitmask.  For example, an
	 * artifact-land would be MTG_CARD_LAND | MTG_CARD_ARTIFACT.
	 */
	public static final int MTG_CARD_ARTIFACT =    0x01;
	public static final int MTG_CARD_LAND =        0x02;
	public static final int MTG_CARD_CREATURE =    0x04;
	public static final int MTG_CARD_ENCHANTMENT = 0x08;
	public static final int MTG_CARD_SORCERY =     0x10;
	public static final int MTG_CARD_INSTANT =     0x20;

	public final int MTG_CARDATTR_LEGENDARY		= 0x01;

	protected String   cardName;
	protected MTGArt   cardArt;
	protected int      cardType;
	protected int      cardAttr;		/* special attributes */


	public MTGCard(String name, int type)
	{
		this.cardName = name;
		this.cardType = type;
	}

	public boolean isArtifact()
	{
		return ((cardType & MTG_CARD_ARTIFACT) == MTG_CARD_ARTIFACT ? true : false);
	}
	
	public boolean isLand()
	{
		return ((cardType & MTG_CARD_LAND) == MTG_CARD_LAND ? true : false);
	}
	
	public boolean isSpell()
	{
		int spell = MTG_CARD_ARTIFACT | MTG_CARD_CREATURE | MTG_CARD_ENCHANTMENT |
		  MTG_CARD_SORCERY | MTG_CARD_INSTANT;
		
		return ((cardType & spell) != 0) ? true : false;
	}
}
